Comparing the Representation of a Simple Visual Stimulus across the Cerebellar Network

The cerebellum is a conserved structure of the vertebrate brain involved in the timing and calibration of movements. Its function is supported by the convergence of fibers from granule cells (GCs) and inferior olive neurons (IONs) onto Purkinje cells (PCs). Theories of cerebellar function postulate that IONs convey error signals to PCs that, paired with the contextual information provided by GCs, can instruct motor learning. Here, we use the larval zebrafish to investigate (1) how sensory representations of the same stimulus vary across GCs and IONs and (2) how PC activity reflects these two different input streams. We use population calcium imaging to measure ION and GC responses to flashes of diverse luminance and duration. First, we observe that GCs show tonic and graded responses, as opposed to IONs, whose activity peaks mostly at luminance transitions, consistently with the notion that GCs and IONs encode context and error information, respectively. Second, we show that GC activity is patterned over time: some neurons exhibit sustained responses for the entire duration of the stimulus, while in others activity ramps up with slow time constants. This activity could provide a substrate for time representation in the cerebellum. Together, our observations give support to the notion of an error signal coming from IONs and provide the first experimental evidence for a temporal patterning of GC activity over many seconds.


Introduction
To orchestrate appropriate motor reactions and maximize the survival chances of the organism, brains need to generate sensory representations of the environment and its changes.The cerebellum has long been considered one of the main regions involved in the integration of sensory and motor representations and plays a central role in motor coordination, the control of fine motor skills, and the calibration of reflexes and motor learning (Ito, 2006).These abilities are supported by the convergence of two information streams onto Purkinje cells (PCs): parallel fibers and climbing fibers (Eccles et al., 1967).
Parallel fibers run in the molecular layer of the cerebellum and originate from granule cells (GCs), the most abundant cell type in the human brain (Williams and Herrup, 1988).Thousands of parallel fibers establish excitatory synapses onto a single PC.Inspired by these numbers, the first theories of cerebellar function proposed that GCs sparsely code and expand the dimensionality of inputs, which originate in precerebellar nuclei and arrive at GCs via mossy fibers (Marr, 1969;Albus, 1971).This high-dimensional representation of sensory information allows selective and differential weighting of stimulus properties and the acquisition of context-dependent cerebellar-guided behavioral responses (Dean et al., 2010).The wide scope of modalities that can be represented by GCs encompasses sensorimotor (Knogler et al., 2017), somatosensory (Arenz et al., 2009), and even predictive (Giovannucci et al., 2017;Wagner et al., 2017) information, but recent studies have challenged the notion of sparse representations (Giovannucci et al., 2017;Knogler et al., 2017;Wagner et al., 2017).In addition to sparse coding, theories postulate that GCs can provide temporal information to PCs, as feedforward control of movement depends on the ability of the cerebellum to perform temporally specific learning (Kawato and Gomi, 1992;Ohyama et al., 2003) although see Johansson et al. (2014).The large number of GCs makes them suited to encode this information, but while temporal patterning of GC responses has been assumed in multiple theoretical studies (Buonomano and Mauk, 1994;Medina et al., 2000;Medina and Mauk, 2000), little empirical evidence has been found so far (but see Kennedy et al., 2014).
The second stream arriving at PCs via climbing fibers originates in inferior olive neurons (IONs).Each PC is initially contacted by a few climbing fibers and then pruned during development to a single one (Crepel, 1982;Bosman and Konnerth, 2009;Hsieh et al., 2014), which fires at low frequency and evokes large and sustained depolarizations (Eccles et al., 1966).Most widespread theories argue that climbing fibers convey error signals (D'Angelo et al., 2011;Ito, 2013).These, paired with the contextual information provided by parallel fibers, can guide motor learning (Marr, 1969;Albus, 1971) through long term depression at the parallel fiber to the Purkinje cell synapse (Ito, 2000).
To characterize and compare the functional properties of these convergent information streams, we studied them in the olivocerebellar circuit of the zebrafish larvae.The zebrafish cerebellum shares the same basic circuitry with the mammalian cerebellar cortex (Bae et al., 2009;Hamling and Tobias, 2015) but contains a greatly reduced number of neurons, and its cells are already differentiated by 5 d postfertilization (dpf; Hibi and Shimizu, 2012).Moreover, the fish cerebellum has been implicated in several sensory-motor behaviors such as the optokinetic reflex (Portugues et al., 2014) and optomotor response adaptation (Ahrens et al., 2012;Markov et al., 2021).
Taking advantage of the optical transparency of the fish larvae and the availability of transgenic lines that express in specific cell types of the circuit, here we sequentially monitored whole-field luminance responses of all main cerebellar subpopulations in awake and sensing zebrafish larvae.These experiments allowed us to study how GCs and IONs convey different information about the same stimulus.We observed that while GCs showed sustained responses carrying accurate information about the current state of the sensory input, IONs responded mostly to stimulus changes.Moreover, we were able to observe the signs of temporal integration in GC responses, suggesting that their activity could provide a basis for temporal coding in the cerebellum.Finally, we investigated how GC and ION response profiles are integrated at the level of PCs.

Zebrafish lines
The following experiments were performed with 6-8 dpf zebrafish (Danio rerio) larvae.Before experimentation, larvae were kept on a 14 h light/10 h dark cycle and at a constant temperature of 28°C.Three types of transgenic lines in a nacre (mitf−/−; Lister et al., 1999) genetic background were used for functional imaging experiments.For GC and ION imaging, a modified fast calcium indicator under the UAS promoter UAS:GCaMP6fEF05 (Felix et al., 2021) was expressed either under a GC-specific Tg(gSA2AzGFF152B) (Takeuchi et al., 2015) or ION-specific Tg(hspGFFDMC28C) (Takeuchi et al., 2015) Gal4 promoter.For PC imaging, GCaMP6s was expressed under a direct PC promoter Tg(PC: GCaMP6f) (Knogler et al., 2019).For behavioral experiments, the Tuepfel long-fin wild-type strain was used.Experiments were performed at a developmental stage at which no sexual differences are yet observable.All procedures related to animal handling were conducted following protocols approved by the Technische Universität München and the Regierung von Oberbayern.

Stimuli
All stimuli were presented to the lower part of the visual field of the fish, to cover the whole base of the dish where the larvae were embedded or swimming.These stimuli consisted of different combinations of sharp luminance changes, and their display was controlled with Stytra (Štih et al., 2019).For the experiments presented in this study, two different protocols were used.The "steps" protocol consisted of 5 s luminance steps of three different brightness levels (corresponding to 5, 20, and 100% of the maximal luminance, chosen to map quasi-logarithmically the dynamic range of the projector) with 7 s interstimulus intervals.All the possible luminance transitions between the different levels were sampled in each repetition.The "flashes" protocol consisted of 3, 7, and 21 s flashes of maximal brightness, interspaced by 7 s interstimulus intervals.The projectors were calibrated before the design of the stimuli: the lowest and highest luminances (corresponding to 0 and 255 pixel brightness values) were 0.3 and 55.7 lux, respectively.

Freely swimming behavioral experiments
For behavioral experiments, 6-7 dpf fish larvae were placed three at a time in ∼1 cm of water in a rectangular-shaped arena cut in a 1% agarose matrix in 88 mm Petri dishes.The dish was placed on top of a light-diffusing screen mounted on a clear acrylic support, illuminated from below using an array of infrared LEDs (setup fully described by Štih et al. (2019) and in Stytra documentation).Larvae were tracked online at 500 Hz using a high-speed camera (Ximea MQ013MG-ON) with Stytra.Visual stimulation was displayed from below using an Asus P2E microprojector and a cold mirror (Edmund Optics).A red long-pass filter (Kodak Wratten No. 25) was placed after the projector to match the absolute luminance values and wavelength of the imaging experiment stimulation.In freely swimming experiments, we used the "steps" protocol, presented a total of 36 times (1 h total duration).

Functional imaging experiments
For functional imaging, larvae were placed in 35 mm Petri dishes and embedded in 2.5% agarose.The dishes were placed onto an acrylic support, on top of a light-diffusing screen, and either the cerebellum or the inferior olive was systematically imaged with a custom-built two-photon microscope.For excitation, a Ti:sapphire laser (Spectra-Physics Mai Tai) tuned to a 905 nm wavelength was used.Visual stimuli were projected from below at a rate of 60 frames per second using an Asus P2E microprojector, and a red long-pass filter (Kodak Wratten No. 25) was placed in front of the projector.Imaging frames were acquired every 248.88 ms (for cerebellum imaging) or 246.38 ms (for inferior olive imaging).The protocol was presented six times while acquiring every plane, and then the focus was shifted ventrally to 1.5 μm (for cerebellum imaging) or 1 μm (for inferior olive imaging), and the process was repeated.For every fish, ∼50-70 planes were imaged.

Image processing
Alignment.2P data were first aligned with a plane-wise rigid transformation.A reference image for each plane was computed as the average of 50 frames, and displacement of each plane from the reference was found through image cross-correlation and corrected with rigid translation.Frames with a correlation peak of >10 microns from the center, usually coming from motion artifacts, were set to NaN and discarded in the following analyses.To correct for shifts happening between planes, a similar procedure was followed calculating shifts from one plane to the next using crosscorrelation between consecutive plane averages.

ROI extraction.
For ROI extraction, we used a combination of approaches.For GCs and PCs, as the number of cells is high, manual segmentation would be unfeasible; but, as responsive cells were generally reliable, it was possible to reconstruct individual ROIs spanning multiple planes, thanks to the similarity of the signal between planes.For IONs, the sparse activity made it difficult to match ROI activity across planes based on correlation, but the low number of cells (∼80 per fish) made manual segmentation feasible.
For automatic ROI extraction, we used the same iterative procedure described by Markov et al. (2021).Briefly, a spatial correlation map was computed where each pixel was assigned a value corresponding to the correlations over time between its fluorescence and the average fluorescence of the eight neighbor pixels.Then, starting from the yet unassigned pixel with the highest correlation value (seed), neighbor pixels were included in the ROIs if their fluorescence correlation with the average fluorescence of the ROI grown so far passed a certain threshold.
For manual ROI extraction, a custom Python graphical user interface was used to draw ROIs on the correlation maps.

Response analysis
All the analysis on the obtained traces was done in Python; Jupyter Notebooks generating all the figures of the paper are available in the linked repository.
Reliability index and filtering.To find a measure of responsiveness to the presented stimulus as independent as possible from the specific response profile, we calculated for each ROI the average correlation of the responses across all individual presentations of the stimulus.The distribution of the obtained correlations had a peak close to zero and a second peak (or a long tail) of positive correlations corresponding to responsive cells.To use an objective criterion to select responsive cells, we used Otsu's method from the SciPy package to set a threshold on the obtained histogram.
Hierarchical clustering.Next, we calculated the mean response for each responsive ROI, and we used the ward algorithm for hierarchical clustering (from the SciPy package) to cluster them.We manually specify a cut on the clustering tree to obtain the discrete clusters that we use in the rest of the analysis.We arbitrarily decided on a threshold that was low enough to include all clusters with qualitatively different changes in their response properties.
Regressor analysis.For regressor-based analysis, we manually designed a set of regressors starting from either luminance profiles with a gamma correction of 1, ½, or 2; the difference between the luminance profile with Gamma 2 and with Gamma 1 (imitating intermediate luminance responses); and ON, OFF, and combined ON and OFF transitions (Extended Data Fig. 3-1).The obtained regressors were then convolved with a kernel of 3 s, to match the temporal response of GCaMP6fEF05.For each cell, Pearson's correlation with all regressors was computed.
Center of mass sorting.The center of mass (COM) was defined as the point in time where the integral of the neuronal trace reached half of its total integral value.To cross-validate the plots, the value for each ROI was estimated based on the half of neuronal responses that were not used for the plotting (Extended Data Fig. 5-1A).
Decoding.To decode different information from the cell activities, we used standard methods from the scikit-learn Python package (Pedregosa et al., 2011).Every decoding analysis was trained on 10 randomly chosen trials and tested on 2 others (only cells with data from 12 or more trials were used in the analysis).Ridge regression was used to decode the time since stimulus onset (Fig. 5E).Kernel-based support vector regression was used as shown in Figure 3D.Grid search over the one regularization parameter was performed in all cases by leaving out each of the 10 training trials.For all decoding analyses, we have to caution that the population activity used to decode the populations is constructed.Neurons were sampled from different repetitions and animals, therefore destroying correlations between neurons.In many cases, such correlations, often termed noise correlations (because these remain unaccounted for after taking out stimulus responses) can have a significant impact on the decoding quality (Moreno-Bote et al., 2014).The decoding analysis is provided together with the rest of the analysis code.
Model fitting.For the PC modeling analysis, we used the data acquired with the "steps" protocol.First, we calculated average responses from all the GC and ION clusters (eight clusters of GCs and six clusters of IONs).To address potential differences in time constants between calcium sensors, we deconvolved average responses using the GCaMP6fEF05 kernel and convolved using the GCaMP6s kernel to match the sensor used in PCs.The resulting average traces were normalized to be strictly positive and with integral 1.Then, the traces from luminance responsive PCs were Z-scored on a trial-by-trial base, high-pass filtered with a very low cutoff frequency (1/80 Hz) to remove slow drifts, and smoothed with a 3 pts mean boxcar window to reduce noise.
The function that was optimized for each cell was the following: where: • PC i (t) is the trace for the ith PC cell.
• GCregressors j (t) and IONregressors k (t) are the GC and ION regressors respectively.
The optimization was done on the following parameters: • offset: a constant term, bound to be between −5 and 5 • coeffsGC: coefficients for GC regressors, bound to be between 0 and 1,000 • coeffsION: coefficients for ION regressors, bound to be between 0 and 1,000 The large coefficient boundaries come from the different normalizations applied on regressors-norm-and on trace Z-scoring.
For each cell, two stimulus repetitions ("test" data) were left out to be the final test traces for the analysis and excluded from the entire fitting process.The remaining repetitions (four or more, for cells spanning multiple planes) were used to find the regularization term and do the fit.
To find the L1 regularization lambda parameter, we used leave-one-out cross-validation to calculate fit costs over a logarithmic sweep of lambdas between 10 −7 and 10 −2 .We trained the model on all the fit traces but one, and we calculated the fit cost on the remaining trace and took the average value across all the left-out traces.Then, we calculated the average lambda and used it for all cells, to allow for a more appropriate comparison of the fit parameters across cells.
After the cross-validation of regularization lambda, the parameters were fit over all the "fit" repetitions.The "test" repetitions were then used to estimate the final fit performance for all the plots in Extended Data Figure 6-2.
To quantify the relative contribution of GC and ION clusters across the PC population, we computed for each cell a GC/ION ratio index going from −1 (only ION clusters with nonzero weights) to +1 (only GC clusters with nonzero weights).

Behavioral analysis
To analyze the behavioral responses to the luminance transitions, we started with raw velocity traces saved by Stytra.As zebrafish larvae swim in discrete events called bouts, the fish speed was thresholded to extract individual bout events.The time occurrence of each bout event relative to the presented stimulus was binned, and a histogram of bout times was obtained for each fish (Extended Data Fig. 1-1A).To assess whether the decrease of bout probability after each luminance OFF transition was statistically significant, we bootstrapped a distribution of bout probabilities from the histogram of each fish and compared the average bout probability 1.5 s after the OFF transition with the first percentile of the bootstrapped distribution (Extended Data Fig. 1-1C).In all but three fish, the post-transition probability was lower than the first percentile of the histogram (Extended Data Fig. 1-1C,D).

Data and code availability
All data and code to reproduce the manuscript has been made public: • All the source data can be found at https://zenodo.org/records/7071735.
• Analysis code including code that generates all the figures in the paper can be found at https://zenodo.org/records/11208720 and is available as Extended data.

Experiment description and anatomy
We exploited the optical transparency and the genetic amenability of the larval zebrafish to follow how information over a simple visual stimulus is processed and transformed through different elements of the cerebellar circuitry.We employed two-photon microscopy in restrained zebrafish larvae to monitor neuronal activity while presenting them with visual stimuli projected on a screen below (Fig. 1A).Larvae expressed GCaMP6s or a modified slow version of GCaMP6f (GCaMP6fEF05) in either GCs, PCs, or IONs (see Materials and Methods).The entire volume of either the cerebellum or the inferior olive was scanned in 1 μm (for the inferior olive) or 1.5 μm (for the cerebellum)-spaced planes.In this way, we were able to acquire the responses of a large fraction of the GC, PC, or ION populations (Fig. 1B).
Figure 1.Experiment description and anatomy.A, Experimental setup: a two-photon microscope was used to image 7 dpf head-restrained larvae while flashes of different luminance were projected on a screen below.B, Composite image showing stacks from GCs (red), IONs (in blue), and PCs (green) registered on a reference anatomy with the whole brain of a 7 dpf larva (in gray).In the enlargements, examples of the raw anatomy (in gray) and the segmented ROIs from a two-photon imaging session (in red, blue, and green for GCs, IONs, and PCs, respectively).See Extended Data Figure 1-1 for more details on the behavior elicited.
Zebrafish larvae are highly visual animals, and previous studies (Knogler et al., 2017) have shown that luminance is very salient for neurons in the fish cerebellum.Therefore, we decided to investigate the diversity of responses across cell types as whole-field luminance was changed over a screen placed below the fish.This protocol elicited only a very mild behavior (Extended Data Fig. 1-1A), slightly reducing bout probability after light-to-dark transitions (Extended Data Fig. 1-1B,D), allowing us to analyze the sensory representations of the stimulus without the confounding effect of motor-related activity.

Responses of GCs and IONs to different luminance levels
In the first set of experiments, we investigated the responses of GCs and IONs during a protocol where luminance was changed between four distinct levels.The progression was designed to ensure that transitions between all pairs of luminance levels were sampled (Extended Data Fig. 2-1A).The entire sequence was presented six times during the imaging of every plane, yielding a robust number of repetitions for all ROIs.

Granule cells
We collected the responses of 5,013 ROIs from five larvae.To estimate how many cells were reliably engaged by the stimulus, we calculated the average correlation of calcium activity during each pair of stimulus trials ("reliability score").In the GC population, the distribution of the obtained reliability scores was clearly bimodal (Fig. 2A) with a fraction of about half strongly responsive cells (47.2% with an automatic thresholding, see Materials and Methods).
To explore the diversity of GC responses to the stimulus, we employed hierarchical clustering to classify the average response of all luminance-selective neurons (Fig. 2A).The main branching in the distance tree arose from the distinction between ON and OFF cells, hereby defined as the property of an ROI of exhibiting a positive or negative calcium transient in response to an increase in the luminance level.The ON and OFF populations represented 57 and 43% of the responsive ROIs, confirming previous reports (Knogler et al., 2017).However, the presentation of intermediate luminance steps revealed the presence of a minority of ROIs (clusters GC4-GC5) that were specifically recruited by intermediate levels of luminance while silent at either minimum or maximum luminance (Fig. 2A, Extended Data Fig. 2-1B).
ON and OFF cells did not respond in a homogeneous way to the battery of stimuli.First, we note that granule cell activation was almost always sustained during the entire presentation of each luminance step.Second, cells in both the ON and OFF clusters largely differed in terms of their threshold and saturation points (Extended Data Fig. 2-1B).Finally, for some clusters, the activation during the presentation of an intermediate luminance level strongly changed depending on the previous luminance level (Extended Data Fig. 2-1C).

Inferior olive
We then turned to the analysis of the responses of IONs (495 cells from five fish).IONs were less selective for the luminance stimulus, with a smaller fraction of cells (12.9% with automatic thresholding) exhibiting reliable responses across stimulus presentations.Even if the number of luminance-selective cells was smaller, we could observe a broad diversity of responses in the IONs, with several types of response profiles appearing across fish (Fig. 2B).In striking opposition with the sustained responses observed in GCs, ION responses were generally transient, peaking immediately after luminance transitions and quickly decaying afterward.Some IONs were selective to either OFF or ON transitions (clusters ION1 and ION3), while others were recruited by both (ION4).Only a minority of cells showed sustained activation during high luminance periods (ION2, 14%), while two other clusters showed sustained activation during intermediate levels of luminance (ION5 and ION6).Interestingly, in cluster ION6, neurons seemed to combine a sustained activation during intermediate luminance levels with a marked transient activation upon stimulus transitions involving luminance decrements.
Taken together, these observations suggest that the two cerebellar input streams might convey complementary information to PCs.On the one hand, GCs almost always presented sustained activation during the luminance steps, with a broad diversity of responses coming from different thresholds and saturation points.On the other hand, most IONs reacted to sharp transitions in the presented stimulus.

GCs and IONs respond to stimulus intensity and derivative, respectively
To further investigate this point, we carried out a regression-based analysis of the individual cell responses to better describe these different behaviors.We created a panel of regressors of two different kinds.The first group included regressors obtained by applying different gamma corrections to the raw luminance profile to describe responses with different thresholds and saturation points, plus a regressor obtained by subtracting two luminance traces with different gamma corrections to account for intermediate luminance-selective cells.The second group included regressors created from the luminance derivative: ON transitions, OFF transitions, or both (Fig. 3A).We then looked at the distribution of the best predictor for each GC and ION in the dataset.While GCs show large correlations with luminance levels and small correlations with transition-related regressors, IONs were divided into a group showing high luminance-related correlations and a group showing high transition-related correlations.Overall, a larger fraction of ION responses was better predicted by transition-related regressors compared with GC responses (42.4% of IONs vs 3% of GCs, Fig. 3B,C).If our observations are true, it should be possible to accurately predict absolute luminance values (the only instantaneous property of the stimulus) from GC activity and more accurately predict transitions of the stimulus from ION activity.By using a nonlinear decoder (a radial-basis function support vector machine regressor), we tried to decode the current luminance level from the activity of IONs or subsets of GCs matching in the size of the ION population.This confirmed that the displayed luminance can be decoded to a higher degree of accuracy from GCs compared with the inferior olive (IO) population, which has more transitory and inconsistent responses (Fig. 3D).

Responses of GCs and IONs to flashes of different duration
Looking at the temporal dynamics of the GC responses, we noticed that in some clusters, fluorescence was still markedly increasing at the end of the luminance step (cluster GC2, Fig. 2A).We reasoned that this could be the hallmark of temporal integration of the luminance stimulus.Temporal integration has been suggested as a timing mechanism that the cerebellum could exploit to keep track of the period elapsed since stimulus onset, as is required for the acquisition of appropriately timed cerebellar-dependent responses such as eyeblink delay conditioning (Medina and Mauk, 2000).Long time constants in GC responses have been postulated in models to account for timing in the cerebellum (Bullock et al., 1994), but they have never been convincingly observed experimentally.
To unravel temporal integration in the responses of the cerebellar circuitry, we designed a second protocol, consisting of three luminance flashes of different durations (3, 7, and 21 s) at maximal luminance (Extended Data Fig. 4-1A).The complete protocol was presented six times in each plane, and the reliability of responses of individual GCs and IONs was assessed as described above.Regressors on the left of the dashed line are luminance related, and regressors on the right are transition related.GCs score higher in luminance-related regressors compared with IONs.C, Scatter plot of the best transition-related coefficient and the best luminance-related coefficient for GCs (red) and IONs (blue) and their relative marginal distributions.The GC population has been downsampled randomly to match the number of IONs, while the marginal distributions refer to the entire population.GCs cluster in the bottom right quadrant of the plot (high luminance-regressor correlation, low transition-regressor correlation), while IONs show higher correlation coefficients for transition-related regressors.D, Performance of a nonlinear decoder used to predict luminance values from GCs (left) and IONs (right) activity.Each point in the swarm plot is one frame of the protocol with the corresponding luminance level (horizontal line).For GCs, 20 iterations of the decoding analysis were performed, with the number of GCs downsampled to match that of IONs.The violin plots in the left panel show the average distribution of predictions across all iterations, while the dots correspond to a single representative iteration.See Extended Data Figure 3-1 for more details.

Granule cells
We sampled 13,763 GCs from five fish and selected a fraction of 26% responsive ROIs for successive analyses (Fig. 4A).As in the previous protocol, the major split in the GC diversity dendrogram corresponded to the difference between ON and OFF cells, (54 and 46% of the responsive cells, Fig. 4A).Interestingly, the population of ON cells contained three clusters whose profiles differed in their temporal dynamics.Cluster GC3 showed the simple sustained activity that was reported in the steps protocol; cluster GC2 rapidly peaked after the flash onset and then decayed to baseline before stimulus end; and cluster GC4 exhibited the response profile expected from a temporal integrator, ramping up slowly for the whole duration of the stimulus presentation.Since the experimental paradigm featured only sustained high luminance periods, we could not compare the kinetics of the luminance ON and the luminance OFF clusters.

Inferior olive
We imaged 337 IONs from five fish, and, consistent with the previous observations, reliably responsive cells (7.1%) were mostly activated by luminance transitions.Moreover, 50% were selective for negative luminance transitions (cluster ION1), 23% were selective for positive transitions (cluster ION4), and 8% for both transition types (cluster ON5).Only 20% of cells had sustained ON or OFF activations (clusters ION2 and ION3, respectively).

Granule cell activity is temporally patterned
Intrigued by the slow temporal dynamics in cluster GC4 (Fig. 4A), we decided to further investigate their temporal response properties.Different GCs responded with very different profiles that were consistent across stimulus presentations (Fig. 5A and Extended Data Fig. 5-1C).Remarkably, some cells from cluster GC4 clearly showed a period of suppressed activity after the stimulus presentation, followed by a positive, "integrator-like" response that could start rising several seconds after the beginning of the stimulus (Fig. 5A, third trace).This might reflect the interplay between excitatory and inhibitory drives having different time constants, whose summing effects give rise to the observed diversity in the GC response timing.
To look at the distribution of time constants in the responses of GCs from ON clusters (GC2, GC3, and GC4), we sorted them by their cross-validated center of mass (COM) computed on the 21 s flash (see Materials and Methods, Extended Data Fig. 5-1A).We observed a continuum between the different response profiles, ranging from early-responding neurons that peak after the flash onset to late-responding neurons with responses slowly ramping up during stimulus presentation (Fig. 5B).Most of the neurons reached their maximal activity shortly after stimulus onset, while many others were still ramping up at the time of its offset (Fig. 5D).IONs did not show any integrating-like responses, and most ON cells peaked immediately after luminance onsets (Fig. 5C,D).
Temporal integration would provide PCs with a representation of time elapsed since stimulus onset, as postulated in models of temporal learning in the cerebellum (Medina and Mauk, 2000;Yamazaki and Tanaka, 2009).Therefore, we examined whether it is possible to linearly decode this time from the activity of an equal number of GCs or IONs.We observed that this decoding is possible to a high degree of accuracy by using the activity of granule cells (Fig. 5E), with an R 2 value of ∼0.8.Since the temporal dynamics are nonlinear and share a saturating trend at longer durations, the optimal linear decoder overestimates the time at shorter durations and underestimates longer durations (Fig. 5E).The inferior olive cells, on the other hand, show no long-term temporal patterning, and it was therefore not possible to decode the duration of the stimulus presentation (R 2 = 0.29, Extended Data Fig. 5-1B).
We conclude that the GCs exhibit diverse temporal dynamics that could provide PCs with a temporal basis for reading out the time since stimulus onset.

PC responses to luminance stimuli
Both parallel fibers from GCs and climbing fibers from IONs make synaptic contact with PCs.Therefore, we decided to investigate the responses of PCs to the same battery of stimuli, to understand how the afferent cerebellar inputs are integrated when they converge at the level of their postsynaptic target.We used a transgenic line that expresses GCaMP6s selectively in all PCs.It is important to note that the unique biophysics of the PC spiking properties (viz., the difference between complex spikes elicited by climbing fibers and the simple spiking modulated by parallel fibers) might complicate the mapping between intracellular calcium-related fluorescence and spiking activity.Nevertheless, previous data (Knogler et al., 2019) have shown that both complex spikes and bursts of simple spikes induce comparable GCaMP6s fluorescence signals in fish PCs.
We first analyzed the responses of PCs to the "steps" protocol (Fig. 6A) in 3,318 ROIs from five fish.Of these, 20.3% were recruited by the stimulus.Given the well-characterized nature of synaptic inputs of PCs, we expected to find response profiles reflecting the profiles observed in the GC and the ION populations.PCs showed both ON and OFF selectivity, a fraction of which were selective for intermediate luminance levels, as was observed in GCs (cluster PC1).However, there were significantly more ON cells than OFF cells (67 vs 32%, respectively) suggesting that the former are overrepresented in PCs compared with GCs.Importantly, from the clustering approach, we could find only one definite group of cells showing transient, transition-related activity (PC3), while most clusters looked modulated mainly by GC inputs.
Then, we turned to the investigation of PC activity during the "flashes" protocol (Fig. 6B), analyzing the responses of 2,267 ROIs from five fish (25.9% responsive).PC activation profiles showed mixed IO and GC features.Just as in GCs, there were many late-responding ROIs that exhibited integrating-like responses (cluster PC3).While the indicator expressed in PC was the slower GCaMP6s, we believe that the difference in the indicator time constant (1-1.5 vs 0.7-1 s) could not account for this difference over long timescales.No cluster showed a constant, sustained response throughout the stimulation period.This is surprising, as the known biophysical properties of PCs would allow them to produce bistable activation (Sengupta and Thirumalai, 2015); it is possible that while stimulus transition could trigger an upstate in some PCs, the transition to downstate could happen before the end of the stimulus.Finally, a large group of ON cells showed only a transient ION-like activation after luminance onset (cluster PC4) that was faster than the one observed in GCs (cluster GC2 in Fig. 4), suggesting input from IONs only.
We finally asked to what extent PC activity could be expressed as a weighted linear sum of the various GC and ION profiles we found.We used multivariate linear regression with cross-validation and LASSO regularization to reconstruct the individual stimulus responses of each PC as a weighted sum of the GC and ION regressors plus an offset term (Extended Data Fig. 6-2A and Materials and Methods).As both these populations contact PCs with excitatory synapses, we constrained the model to have only positive weights.The activity of most cells was successfully captured by our simple linear model (Extended Data Fig. 6-2C), with ∼57% of cells with a better-than-chance fit cost (Extended Data Fig. 6-2B).The distribution of weights across PCs (Extended Data Fig. 6-2D) matched the clusters observed in Figure 6A, and as expected, there was an inverse relationship between fit cost and cell reliability (Extended Data Fig. 6-2E).Overall, we observed that PC calcium responses can be reconstructed as a linear combination of GC and ION response profiles.We investigated this by computing a GC/IO index (see Materials and Methods) quantifying average contributions to individual PC activity (Extended Data Fig. 6-2F).Although the calcium response of most PCs was better predicted using loads on GC regressors, the PC population exhibited a broad diversity of GC versus ION loads.Given the differences in the  2A,B), we would expect that PCs dominated by GC inputs would show a higher reliability.This was indeed the case, and there was a significant positive correlation between the reliability index of the PC and the GC contribution to its activation (Spearman ρ = 0.19, p = 0.0006; Extended Data Fig. 6-2F).In conclusion, we observed that PC calcium responses can indeed be reconstructed as a linear combination of GC and ION response profiles.Although the activity of most PCs was better predicted using loads on GC regressors, the PC population exhibited a broad diversity of the GC versus ION loads, ranging from ION inputs only to GC inputs only.

Discussion
Here, we undertook a large-scale investigation of the representations of a simple visual stimulus in the olivocerebellar system of larval zebrafish at the single-cell level.Previous reports have been exploring the responses of individual cell bottom (bottom panels).The above traces represent the average response for ROIs binned according to the time at which their COM was reached (green for early-responding neurons, brown for late-responding ones).C, Same plot as in B, for IONs.In this case, traces in the top panels correspond to single ROI responses.D, Probability density function describing the time points at which responses of neurons from the two imaged populations reach their maximal response.E, Scatter plot of predicted versus actual time elapsed stimulus onset.Prediction was performed at each frame from ION activity (blue dots) and activity of a random subset of GCs (red dots).The red line and shaded area show average ± standard deviation of predictions from 200 GCs subsets.See Extended Data Figure 5-1 for more details.types in the cerebellar circuitry (Knogler et al., 2017(Knogler et al., , 2019;;Harmon et al., 2020;Felix et al., 2021).Building on this previous work, we have systematically explored the responses of IONs and GCs to changes in luminance.Furthermore, we recorded activity in PCs, which receive both GC and ION input, in order to understand how they could combine these signals.

Stimulus state and transition coding in GCs and IONs
We observed that a large fraction of GCs were recruited by our sensory stimulation, strengthening previous observations that point against the notion of sparse coding in GCs (Giovannucci et al., 2017;Knogler et al., 2017;Wagner et al., 2017).Responses clustered into a few groups which, nevertheless, displayed a diversity of response properties, varying in their sign, threshold, and saturation points.Intriguingly, some GCs were not clearly luminance ON or luminance OFF but were excited by intermediate luminance and inhibited by strong luminance (and vice versa).This activity profile could be easily generated by the interplay between an excitatory input coming via mossy fibers and recurrent inhibition provided by Golgi cells, combined with different threshold and saturation levels in GCs (Bratby et al., 2017).However, we cannot exclude that such responses are not directly inherited by precerebellar inputs (Barker et al., 2017).The diversity observed in these response types would suggest that the representation of the sensory input in the GC layer is not only dense but also allows to reliably decode the presented luminance even from the responses of small subsets of GCs.
On the other side, a smaller fraction of IONs showed consistent responses during our simulation.Importantly, the responses of IONs were much more phasic in nature compared with GC, with a single peak following light-to-dark or dark-to-light transitions (or, less often, both).This observation is in agreement with the idea that climbing fibers report "error" or "salience" signals that can result in cerebellar learning by inducing plasticity on GC to PC synapses, which convey contextual evidence about the state of the environment.As a result, while decoding the presented luminance from ION activity was worse than GC activity-based decoding, ION traces allowed for more reliable discrimination of the stimulus transition times.
Together, these observations confirm the idea that parallel fibers from GCs provide contextual evidence to the cerebellum, while IONs code for sudden changes in the environment, a central tenet of models of learning in the cerebellum.

Temporal coding in GC responses
The cerebellum is involved in the acquisition and timing of motor sequences.This is exemplified in classic paradigms of delay conditioning, where the conditioned motor response has to be precisely delayed from the onset of the conditioning stimulus.This requires that even the simple conditioning stimuli used in paradigms such as eyeblink conditioning need to evoke GC responses that vary in time so that selective reinforcement of some parallel fiber synapses can modulate the PC firing rate at specific intervals from the onset of the stimulus.Several mechanisms have been proposed to underlie such temporal patterning (Medina and Mauk, 2000;Yamazaki and Tanaka, 2009).On the one hand, in delay line models, the stimulus-elicited activity is delayed by a fixed amount of time by a variable number of synaptic connections in the precerebellar neurons that impinge onto each GC, making the activity of GCs sparse in time, with variable onsets (Moore et al., 1989).On the other hand, in oscillatory models, the responses of GCs are supposed to be oscillatory, with a different characteristic frequency in each GC so that they can sum up to form a basis for arbitrarily delayed PC responses (Gluck et al., 1990).Finally, in spectral models, the temporal patterning arises as a combination of varied membrane time constants in GCs and in inhibitory companion Golgi cells, which generate unique time constants for the ON and OFF phase of each GC (Bullock et al., 1994;Bratby et al., 2017).
Previous studies have reported the existence of temporal patterning over hundreds of milliseconds in the GCs of the electrosensory lobe, a cerebellum-like structure in the brainstem of mormyrid fish (Kennedy et al., 2014).However, this has never been investigated at the whole GC population and at timescales of several seconds.Previous work on larval zebrafish has reported no evidence of temporal patterning in GCs (Knogler et al., 2017), but they analyzed temporal patterning in recordings from a very limited number of neurons.In our experiments, we could find no evidence for temporally sparse or oscillatory activity (in the frequency range observable given the sampling rate, i.e., below 2 Hz).Interestingly, however, we do see a continuum spectrum of delay in the responses, from fast offset GCs to GCs whose activity was suppressed for several seconds before starting to ramp up.This was happening over a much longer timescale than what usually has been investigated in cerebellar studies.We report GCs whose onset was followed by up to 5-6 s the stimulus onset and whose activity was still increasing after 20 s of stimulus presentation.IONs, on the other side, were carrying very little temporal information about the ongoing stimulus.A decoding approach confirmed that accurate prediction of time occurred since stimulus onset was possible from GC activity but not from ION activity.Our data suggest that GCs can indeed provide a base for temporal coding in the cerebellum and strongly support the spectral timing model for temporally specific cerebellar learning.

PC integration of GC and ION activity
Finally, we aimed to describe the calcium dynamics in PCs as a linear combination of IONs and GCs inputs.It has already been shown that such a linear modeling on afferent inputs can provide a good description of the PC activity (Chen et al., 2017;Tanaka et al., 2019;Markanday et al., 2023).Indeed, we could describe most of the PC calcium activity as a linear weighted sum of responses from IONs and GC clusters.We observed some heterogeneity in the contribution from ION and GC clusters between cells, with some PC cells mostly showing ION-like activity and most cells that were described better by GC regressors, hence suggesting that GC and ION inputs related to the same sensory modality do not necessarily converge over the same PCs.An obvious caveat of our study is the focus on calcium imaging dynamics in PCs, as calcium transients might be produced by different biophysical dynamics for ION-elicited complex spikes and simple spikes.However, it was recently shown that in larval zebrafish, both complex spikes and bursts of simple spikes could be detected using the PC:GCaMP6s line (Knogler et al., 2017(Knogler et al., , 2019)), and we could indeed observe both GC-like and ION-like activity in PCs.
In conclusion, our work provides the first characterization of population-wide responses to the same battery of sensory stimuli in GCs, IONs, and PCs in the cerebellum.This approach gives new insights into how stimulus features and timing are differently represented in the two converging cerebellar pathways and are integrated at the level of PCs and could be leveraged in the future to mechanistically address the involvement of the cerebellum in processing sensorimotor signals.

Figure 2 .
Figure 2. Responses of GCs and IONs to the "luminance steps" protocol.A, Left, Histogram of the average intertrial correlation (average correlation between activity recorded in different trials).The calculated threshold and the relative fraction of active cells are reported on the histogram.Center, Average traces grouped after hierarchical clustering.Cutting the dendrogram at the height marked by the line (on the left) resulted in eight different clusters, whose average activity is shown on the right, overimposed on a shade matching at each timepoint the brightness level displayed.B, Same plot as in A, for IONs.See Extended Data Figure 2-1 for more details.

Figure 3 .
Figure 3. GC and IONs respond to stimulus intensity and derivative.A, Regressor-based analysis was used to calculate the correlation coefficient between each cell's fluorescence (lines) and a panel of regressors (shades).The plot shows the cells with the highest correlation values for luminance-related (first two rows) and transition-related (second two rows) regressors.B, Histogram of the distribution of best-fitting regressors for GCs (top) and IONs (bottom).Regressors on the left of the dashed line are luminance related, and regressors on the right are transition related.GCs score higher in luminance-related regressors compared with IONs.C, Scatter plot of the best transition-related coefficient and the best luminance-related coefficient for GCs (red) and IONs (blue) and their relative marginal distributions.The GC population has been downsampled randomly to match the number of IONs, while the marginal distributions refer to the entire population.GCs cluster in the bottom right quadrant of the plot (high luminance-regressor correlation, low transition-regressor correlation), while IONs show higher correlation coefficients for transition-related regressors.D, Performance of a nonlinear decoder used to predict luminance values from GCs (left) and IONs (right) activity.Each point in the swarm plot is one frame of the protocol with the corresponding luminance level (horizontal line).For GCs, 20 iterations of the decoding analysis were performed, with the number of GCs downsampled to match that of IONs.The violin plots in the left panel show the average distribution of predictions across all iterations, while the dots correspond to a single representative iteration.See Extended Data Figure3-1 for more details.

Figure 4 .
Figure 4. Responses of GCs and IONs to the "flashes" protocol.A, Top-left, Intertrial correlation histogram of GCs for the "flashes" protocol.Center, Cells sorted after hierarchical clustering and (right) average activity for each cluster.B, Same plot as in A, for IONs.See Extended Data Figure 4-1 for more details.

Figure 5 .
Figure 5. Granule cell activity is temporally patterned.A, Single traces for early-(green), sustained-(gray), and late-responding (brown) ROIs.The average response (thick line) is superimposed on all single repetitions (thin lines) of stimulus presentation.B, GCs included in any of the luminance-excited clusters were then sorted based on their center of mass (COM) during the longest flash, with earlier-responding neurons on the top and late-responding ones on the

Figure 6 .
Figure 6.PC responses to luminance stimuli.A, Top-left, Histogram of the average intertrial correlation and its relative threshold.Center, Hierarchical clustering of PC responses to the "steps" protocol, and average activity of the clusters selected after cutting the dendrogram at the height marked by the lines.The shade matches at each timepoint the brightness level displayed.B, Same as in A, for the "flash" protocol.See Extended Data Figures 6-1 and 6-2 for more details.